<!DOCTYPE html>
<html>
<#include "../head.html">
<body>
	<#include "../top.html">
	<!-- div.main start  -->
	<div class="main">
		<!-- div.main_left start  -->
		<div class="main_left"><#include "left.html"></div>
		<!-- div.main_left end  -->
		<!-- div.main_right start  -->
		<div class="main_right">
			<#assign moduleName="逾期管理" >
			<#include "banner.html">
			<div class="main_content">
				<form action="" method="post">
				<table  border="0"  cellspacing="1" bgcolor="#CCCCCC" width="100%">
					<tr>
						<td width="" class="main_td">ID</td>
						<td width="*" class="main_td" align="left">借款人</td>
						<td width="*" class="main_td" align="left">借款标的名称</td>
						<td width="*" class="main_td" align="left">借款金额</td>
						<td width="" class="main_td" align="left">期数</td>
						<td width="" class="main_td" align="left">应还时间</td>
						<td width="" class="main_td" align="left">应还金额</td>
						<td width="" class="main_td" align="left">应还利息</td>
						<td width="" class="main_td" align="left">逾期天数</td>
						<!--<td width="" class="main_td" align="left">逾期利息</td>-->
						<td width="" class="main_td" align="left">明细</td>
						<td width="" class="main_td" align="left">状态</td>
					</tr>
					<#import "../../common/function.html" as func>  
					<#list list as item>
					<tr>
						<td>${item.id?c}</td>
						<td class="main_td1"  align="left">
						<a href="javascript:void(0)" 
							onclick='tipsWindown("用户详细信息查看","url:get?${request.getContextPath()}/admin/attestation/viewUserInfo.html?username=${item.username!}",500,230,"true","","true","text");'>
								${item.username!}
							</a>
						</td>
						<td title="${item.borrow_name!}" align="left">
						<a href="${webroot}/invest/detail.html?borrowid=${(item.borrow_id!0)?c}" target="_blank">${item.borrow_name!}</a><@func.showBorrowIcon item=item/></td>
						<td>${item.account!""}</td>
						<td align="left">${item.order+1}/${item.time_limit}</td>
						<td align="left"><#if item.repayment_time??> ${dateformat(item.repayment_time)} </#if></td>
						<td align="left">${((item.repayment_account!0)?number)?string("###,###.##")}元</td>
						<td align="left">${((item.interest!0)?number)?string("###,###.##")}元</td>
						<td align="left"><#if item.repayment_yestime??>${((item.overdueTime?number)!0)?string("###,###.##")}<#else>${(((item.unRepayTimeOverdue?number)!0))?string("##.##")}</#if>天</td>
						<!-- <td align="left">${(((item.late_interest)!0)?number)?string("##.##")}元</td>-->
						<td align="left"><font color="#006600"><a href="${webroot}/admin/borrow/tenderlist.html?borrow_id=${item.id?c}">明细</a></font></td>
						<td align="left"><font color="#006600"><#if item.repayment_yestime??>逾期已还<#else>逾期未还</#if></font></td>
					</tr>
					</#list>
					<tr>
						<td colspan="8" class="action">
						
							<#if param?exists>
								<#if param.get("username")?exists><#assign username=param.get("username")></#if>
								<#if param.get("keywords")?exists><#assign keywords=param.get("keywords")></#if>
								<#if param??&&param.type??>
									<#assign type=(param.get("type"))?number >
								<#else>
									<#assign type=0>
								</#if>
							</#if>
							<div class="floatr">
							  <a href="#" onclick="exportxls()">导出报表</a>
								标种类型：<select id="types" >
									<option value="0" <#if type==0 >selected="selected"</#if> >全部</option>
									<option value="1" <#if type==1 >selected="selected"</#if> >秒标</option>
									<option value="2" <#if type==2 >selected="selected"</#if> >信用标</option>
									<option value="3" <#if type==3 >selected="selected"</#if> >给力标</option>
									<option value="4" <#if type==4 >selected="selected"</#if> >净值标</option>
									<option value="5" <#if type==5 >selected="selected"</#if> >抵押标</option>
								</select> 
							
								用户名：<input type="text" name="username" id="username" value="${username!}"/> 
								关键字：<input type="text" name="keywords" id="keywords" value="${keywords!}"/> 
								<input type="button" value="搜索"  onclick="sousuo();"  />
							</div>
						</td>
					</tr>
					<tr>
						<td colspan="14" class="page">
							<#import "../../common/page.html" as pager>  
			         	 	<@pager.pagination page=page url="/admin/borrow/late.html" map=param style="style1" /> 
						</td>
					</tr>
		
				</table>
				</form>	
				<script>
				
				var urls = 'overdue.html?search=true';
				var xlsurl = 'overdue.html?actionType=export';

				function sousuo(){
					var sou = "";
					var username = $("#username").val();
					if (username!=""){
						sou += "&username="+username;
					}
					var keywords = $("#keywords").val();
					if (keywords!=""){
						sou += "&keywords="+keywords;
					}
					var type = $("#types").val();
					if (type!=null&&type!=""&&type!="undefine"){
						sou += "&type="+type;
					}
					var succtime1 = $("#succtime1").val();
					var succtime2 = $("#succtime2").val();
					if (succtime1!=null){
						 sou += "&succtime1="+succtime2;
					}
					if (succtime2!=null){
						 sou += "&succtime2="+succtime1;
					}
					
					location.href=urls+sou;
				}
				function exportxls(){
					var sou = "";
					var username = $("#username").val();
					var keywords = $("#keywords").val();
					if (keywords!=""){
						sou += "&keywords="+keywords;
					}
					var type = $("#types").val();
					var succtime1 = $("#succtime1").val();
					var succtime2 = $("#succtime2").val();
					if (succtime1!=null){
						 sou += "&succtime1="+succtime2;
					}
					if (succtime2!=null){
						 sou += "&succtime2="+succtime1;
					}
					if (type!=null&&type!=""&&type!="undefine"){
						sou += "&type="+type;
					}
					if (sou!=""){
						location.href=xlsurl+sou;
					}else{
						location.href=xlsurl;
					}
				}
				</script>
			</div>
		</div>
		<!-- div.main_right end  -->
	</div>
	<!-- div.main end  -->
	<#include "../foot.html">
</body>
</html>
